/**
 * 
 */
package org.mspring.mlog.search.task;

import java.util.Map;

import org.mspring.mlog.search.Searchable;
import org.mspring.mlog.search.engine.SearchEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 
 * @author Gao Youbo
 * @since 2013年8月1日
 */
@Component
public class LuceneDeleteTask extends AbstractLuceneTask {

    @Autowired
    private SearchEngine searchEngine;

    @Override
    protected void doTask(Map<Object, Object> paramMap) throws Exception {
        // TODO Auto-generated method stub
        Searchable searchable = getSearchableEntity(paramMap);
        if (searchable == null) {
            return;
        }
        searchEngine.deleteIndex((Searchable) searchable);
    }

}
